//-----------------------------------------------------------------------
// <copyright file="Capture.cs" company="Rhys Parry">
//    Copyright Rhys Parry 2009
//    This file is released under the Apache 2.0 License
// </copyright>
//-----------------------------------------------------------------------
namespace Smarts.Core.RegularExpressions
{
    using Stre = System.Text.RegularExpressions;

    public class Capture
    {
        private Stre.Capture capture;

        protected Capture(Stre.Capture capture)
        {
            this.capture = capture;
        }

        public int Index
        {
            get
            {
                return capture.Index;
            }
        }

        public int Length
        {
            get
            {
                return capture.Length;
            }
        }

        public string Value
        {
            get
            {
                return capture.Value;
            }
        }

        public override string ToString()
        {
            return capture.ToString();
        }

        public static implicit operator Stre.Capture(Capture capture)
        {
            return capture.capture;
        }

        public static implicit operator Capture(Stre.Capture capture)
        {
            return new Capture(capture);
        }        
    }
}